/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ticketmaster.dao;

import java.io.IOException;
import java.sql.Connection;
import java.sql.SQLException;
import ticketmaster.dataaccess.DataSource;

/**
 *
 * @author Wei Liu
 */
public class DAOFactory
{
    private static DAOFactory instance;

    // method to create MySQL connection
    public static Connection createConnection() throws SQLException, IOException, ClassNotFoundException
    {
        return DataSource.getConnection();
    }

    private DAOFactory()
    {
    }

    public static synchronized DAOFactory getInstance()
    {
        if (instance == null)
        {
            instance = new DAOFactory();
        }
        return instance;
    }

    public CustomerDAO getCustomerDAO()
    {
        return new CustomerDAO();
    }

    public UserDAO getUserDAO()
    {
        return new UserDAO();
    }

    public SeatCategoryDAO getSeatCategoryDAO()
    {
        return new SeatCategoryDAO();
    }

    public SeatDAO getSeatDAO()
    {
        return new SeatDAO();
    }

    public ShippingMethodDAO getShippingMethodDAO()
    {
        return new ShippingMethodDAO();
    }

    public TaxDAO getTaxDAO()
    {
        return new TaxDAO();
    }

    public TicketRateDAO getTicketRateDAO()
    {
        return new TicketRateDAO();
    }

    public EventDAO getEventDAO()
    {
        return new EventDAO();
    }

    public VenueDAO getVenueDAO()
    {
        return new VenueDAO();
    }

    public PremiumCustomerDAO getPremiumCustomerDAO()
    {
        return new PremiumCustomerDAO();
    }

    public PremiumCustomerRewardDAO getPremiumCustomerRewardDAO()
    {
        return new PremiumCustomerRewardDAO();
    }

    public RewardDAO getRewardDAO()
    {
        return new RewardDAO();
    }

    public OrderDAO getOrderDAO()
    {
        return new OrderDAO();
    }

    public TransactionDAO getTransactionDAO()
    {
        return new TransactionDAO();
    }

    public BookedTicketDAO getBookedTicketDAO()
    {
        return new BookedTicketDAO();
    }

    public BookedTicketViewDAO getBookedTicketViewDAO()
    {
        return new BookedTicketViewDAO();
    }

    public BankcardDAO getBankcardDAO()
    {
        return new BankcardDAO();
    }

    public EventViewDAO getEventViewDAO()
    {
        return new EventViewDAO();
    }

    public TicketViewDAO getTicketViewDAO()
    {
        return new TicketViewDAO();
    }
}
